﻿
namespace NetROS.Tiers.Windows.Forms
{
	/// <summary>
	/// This is the abstract edit form for the <see cref="Entities.ReportKolumna"/> entity.
	/// </summary>
	/// <remarks>This class is overwritten by .netTiers at each generation.</remarks>
	[System.ComponentModel.DesignerCategoryAttribute("code")]
	public abstract class ReportKolumnaEditControlBase : System.Windows.Forms.UserControl
	{
		#region Fields
		
		//private System.Windows.Forms.TableLayoutPanel uxTableLayoutPanel;
		/// <summary>
		/// The ErrorProvider for the Entity;
		/// </summary>
		protected System.Windows.Forms.ErrorProvider uxErrorProvider;
		
		/// <summary>
		/// The BindingSource for the entity.
		///</summary>
		protected System.Windows.Forms.BindingSource uxBindingSource;
						
		
		/// <summary>
		/// TextBox for the ID property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxID;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the ID property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDLabel;
		
		/// <summary>
		/// ComboBox for the IDReport property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDReport;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDReport property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDReportLabel;
		
		/// <summary>
		/// TextBox for the PrikazniNaziv property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxPrikazniNaziv;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the PrikazniNaziv property.
		/// </summary>
		protected System.Windows.Forms.Label uxPrikazniNazivLabel;
		
		/// <summary>
		/// TextBox for the NazivUQuery property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxNazivUQuery;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the NazivUQuery property.
		/// </summary>
		protected System.Windows.Forms.Label uxNazivUQueryLabel;
		
		/// <summary>
		/// TextBox for the WhereUpit property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxWhereUpit;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the WhereUpit property.
		/// </summary>
		protected System.Windows.Forms.Label uxWhereUpitLabel;
		
		/// <summary>
		/// ComboBox for the IDReportKolumnaTip property.
		/// </summary>
		protected System.Windows.Forms.ComboBox uxIDReportKolumnaTip;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the IDReportKolumnaTip property.
		/// </summary>
		protected System.Windows.Forms.Label uxIDReportKolumnaTipLabel;
		
		/// <summary>
		/// TextBox for the RedBr property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxRedBr;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the RedBr property.
		/// </summary>
		protected System.Windows.Forms.Label uxRedBrLabel;
		
		/// <summary>
		/// TextBox for the NazivPolja property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxNazivPolja;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the NazivPolja property.
		/// </summary>
		protected System.Windows.Forms.Label uxNazivPoljaLabel;
		
		/// <summary>
		/// CheckBox for the Parametar property.
		/// </summary>
		protected System.Windows.Forms.CheckBox uxParametar;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the Parametar property.
		/// </summary>
		protected System.Windows.Forms.Label uxParametarLabel;
		
		/// <summary>
		/// TextBox for the SelectUpit property. 
		/// </summary>
		protected System.Windows.Forms.TextBox uxSelectUpit;
		
		/// <summary>
		/// The <see cref="System.Windows.Forms.Label"/> associated with the SelectUpit property.
		/// </summary>
		protected System.Windows.Forms.Label uxSelectUpitLabel;
		#endregion
		
		#region Main entity
		private Entities.ReportKolumna _ReportKolumna;
		/// <summary>
		/// Gets or sets the <see cref="Entities.ReportKolumna"/> entity to edit with this form.
		/// </summary>
		/// <value>The <see cref="Entities.ReportKolumna"/> instance.</value>
		public Entities.ReportKolumna ReportKolumna
		{
			get {return this._ReportKolumna;}
			set
			{
				this._ReportKolumna = value;
				if (value != null) 
				{
					this.uxBindingSource.DataSource = value;
					BindControls();
				}			
				
			}
		}
		#endregion
		
		/// <summary>
		/// Binds the controls.
		/// </summary>
		private void BindControls()
		{
			this.uxID.DataBindings.Clear();
			this.uxID.DataBindings.Add("Text", this.uxBindingSource, "ID", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDReport.DataBindings.Clear();
			this.uxIDReport.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDReport", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxPrikazniNaziv.DataBindings.Clear();
			this.uxPrikazniNaziv.DataBindings.Add("Text", this.uxBindingSource, "PrikazniNaziv", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxNazivUQuery.DataBindings.Clear();
			this.uxNazivUQuery.DataBindings.Add("Text", this.uxBindingSource, "NazivUQuery", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxWhereUpit.DataBindings.Clear();
			this.uxWhereUpit.DataBindings.Add("Text", this.uxBindingSource, "WhereUpit", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxIDReportKolumnaTip.DataBindings.Clear();
			this.uxIDReportKolumnaTip.DataBindings.Add("SelectedValue", this.uxBindingSource, "IDReportKolumnaTip", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxRedBr.DataBindings.Clear();
			this.uxRedBr.DataBindings.Add("Text", this.uxBindingSource, "RedBr", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxNazivPolja.DataBindings.Clear();
			this.uxNazivPolja.DataBindings.Add("Text", this.uxBindingSource, "NazivPolja", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxParametar.DataBindings.Clear();
			this.uxParametar.DataBindings.Add("Checked", this.uxBindingSource, "Parametar", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
			this.uxSelectUpit.DataBindings.Clear();
			this.uxSelectUpit.DataBindings.Add("Text", this.uxBindingSource, "SelectUpit", true, System.Windows.Forms.DataSourceUpdateMode.OnPropertyChanged);
		}					
		
		#region Constructor
		
		/// <summary>
		/// Initializes a new instance of the <see cref="ReportKolumnaEditControlBase"/> class.
		/// </summary>
		public ReportKolumnaEditControlBase()
		{
			InitializeComponent();			
			
			this.uxBindingSource.CurrentItemChanged += new System.EventHandler(uxBindingSource_currentItemChanged);
		}		
		
		/// <summary>
		/// 
		/// </summary>
		private void uxBindingSource_currentItemChanged(object sender, System.EventArgs e)
		{
			if (_ReportKolumna != null) _ReportKolumna.Validate();
		}	
				
		/// <summary>
		/// Initializes the component.
		/// </summary>
		public void InitializeComponent()
		{
			this.components = new System.ComponentModel.Container();
			this.uxErrorProvider = new System.Windows.Forms.ErrorProvider(this.components);
			this.uxBindingSource = new System.Windows.Forms.BindingSource(this.components);
			
			//this.uxTableLayoutPanel = new System.Windows.Forms.TableLayoutPanel();
			this.uxID = new System.Windows.Forms.TextBox();
			uxIDLabel = new System.Windows.Forms.Label();
			this.uxIDReport = new System.Windows.Forms.ComboBox();
			uxIDReportLabel = new System.Windows.Forms.Label();
			this.uxPrikazniNaziv = new System.Windows.Forms.TextBox();
			uxPrikazniNazivLabel = new System.Windows.Forms.Label();
			this.uxNazivUQuery = new System.Windows.Forms.TextBox();
			uxNazivUQueryLabel = new System.Windows.Forms.Label();
			this.uxWhereUpit = new System.Windows.Forms.TextBox();
			uxWhereUpitLabel = new System.Windows.Forms.Label();
			this.uxIDReportKolumnaTip = new System.Windows.Forms.ComboBox();
			uxIDReportKolumnaTipLabel = new System.Windows.Forms.Label();
			this.uxRedBr = new System.Windows.Forms.TextBox();
			uxRedBrLabel = new System.Windows.Forms.Label();
			this.uxNazivPolja = new System.Windows.Forms.TextBox();
			uxNazivPoljaLabel = new System.Windows.Forms.Label();
			this.uxParametar = new System.Windows.Forms.CheckBox();
			uxParametarLabel = new System.Windows.Forms.Label();
			this.uxSelectUpit = new System.Windows.Forms.TextBox();
			uxSelectUpitLabel = new System.Windows.Forms.Label();
			
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).BeginInit();
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).BeginInit();
			this.SuspendLayout();
			
			// 
			// uxTableLayoutPanel
			// 
			//this.uxTableLayoutPanel.AutoSize = true;
			//this.uxTableLayoutPanel.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
			//this.uxTableLayoutPanel.ColumnCount = 2;
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 120F));
			//this.uxTableLayoutPanel.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 250F));
			//this.uxTableLayoutPanel.Location = new System.Drawing.System.Drawing.Point(3, 3);
			//this.uxTableLayoutPanel.Name = "uxTableLayoutPanel";
			//this.uxTableLayoutPanel.RowCount = 2;
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 25F));
			//this.uxTableLayoutPanel.Size = new System.Drawing.Size(450, 50);
			//this.uxTableLayoutPanel.TabIndex = 0;
			
			//
			// uxErrorProvider
			//
			this.uxErrorProvider.ContainerControl = this;
			this.uxErrorProvider.DataSource = this.uxBindingSource;
			
			//
			// uxIDLabel
			//
			this.uxIDLabel.Text = "ID:";
			this.uxIDLabel.Location = new System.Drawing.Point(3, 0);
			this.Controls.Add(this.uxIDLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDLabel);			
			//
			// uxID
			//
			this.uxID.ReadOnly = true;
			//this.uxTableLayoutPanel.Controls.Add(this.uxID);
			this.uxID.Location = new System.Drawing.Point(160, 0);
			this.Controls.Add(this.uxID);
			//
			// uxIDReportLabel
			//
			this.uxIDReportLabel.Text = "IDReport:";
			this.uxIDReportLabel.Location = new System.Drawing.Point(3, 26);
			this.Controls.Add(this.uxIDReportLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDReportLabel);			
			//
			// uxIDReport
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDReport);
			this.uxIDReport.Location = new System.Drawing.Point(160, 26);
			this.Controls.Add(this.uxIDReport);
			//
			// uxPrikazniNazivLabel
			//
			this.uxPrikazniNazivLabel.Text = "PrikazniNaziv:";
			this.uxPrikazniNazivLabel.Location = new System.Drawing.Point(3, 52);
			this.Controls.Add(this.uxPrikazniNazivLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxPrikazniNazivLabel);			
			//
			// uxPrikazniNaziv
			//
			this.uxPrikazniNaziv.Width = 250;
			this.uxPrikazniNaziv.MaxLength = 50;
			//this.uxTableLayoutPanel.Controls.Add(this.uxPrikazniNaziv);
			this.uxPrikazniNaziv.Location = new System.Drawing.Point(160, 52);
			this.Controls.Add(this.uxPrikazniNaziv);
			//
			// uxNazivUQueryLabel
			//
			this.uxNazivUQueryLabel.Text = "NazivUQuery:";
			this.uxNazivUQueryLabel.Location = new System.Drawing.Point(3, 78);
			this.Controls.Add(this.uxNazivUQueryLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxNazivUQueryLabel);			
			//
			// uxNazivUQuery
			//
			this.uxNazivUQuery.Width = 250;
			this.uxNazivUQuery.MaxLength = 100;
			//this.uxTableLayoutPanel.Controls.Add(this.uxNazivUQuery);
			this.uxNazivUQuery.Location = new System.Drawing.Point(160, 78);
			this.Controls.Add(this.uxNazivUQuery);
			//
			// uxWhereUpitLabel
			//
			this.uxWhereUpitLabel.Text = "WhereUpit:";
			this.uxWhereUpitLabel.Location = new System.Drawing.Point(3, 104);
			this.Controls.Add(this.uxWhereUpitLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxWhereUpitLabel);			
			//
			// uxWhereUpit
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxWhereUpit);
			this.uxWhereUpit.Location = new System.Drawing.Point(160, 104);
			this.Controls.Add(this.uxWhereUpit);
			//
			// uxIDReportKolumnaTipLabel
			//
			this.uxIDReportKolumnaTipLabel.Text = "IDReportKolumnaTip:";
			this.uxIDReportKolumnaTipLabel.Location = new System.Drawing.Point(3, 130);
			this.Controls.Add(this.uxIDReportKolumnaTipLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDReportKolumnaTipLabel);			
			//
			// uxIDReportKolumnaTip
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxIDReportKolumnaTip);
			this.uxIDReportKolumnaTip.Location = new System.Drawing.Point(160, 130);
			this.Controls.Add(this.uxIDReportKolumnaTip);
			//
			// uxRedBrLabel
			//
			this.uxRedBrLabel.Text = "RedBr:";
			this.uxRedBrLabel.Location = new System.Drawing.Point(3, 156);
			this.Controls.Add(this.uxRedBrLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxRedBrLabel);			
			//
			// uxRedBr
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxRedBr);
			this.uxRedBr.Location = new System.Drawing.Point(160, 156);
			this.Controls.Add(this.uxRedBr);
			//
			// uxNazivPoljaLabel
			//
			this.uxNazivPoljaLabel.Text = "NazivPolja:";
			this.uxNazivPoljaLabel.Location = new System.Drawing.Point(3, 182);
			this.Controls.Add(this.uxNazivPoljaLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxNazivPoljaLabel);			
			//
			// uxNazivPolja
			//
			this.uxNazivPolja.Width = 250;
			this.uxNazivPolja.MaxLength = 100;
			//this.uxTableLayoutPanel.Controls.Add(this.uxNazivPolja);
			this.uxNazivPolja.Location = new System.Drawing.Point(160, 182);
			this.Controls.Add(this.uxNazivPolja);
			//
			// uxParametarLabel
			//
			this.uxParametarLabel.Text = "Parametar:";
			this.uxParametarLabel.Location = new System.Drawing.Point(3, 208);
			this.Controls.Add(this.uxParametarLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxParametarLabel);			
			//
			// uxParametar
			//
			//this.uxTableLayoutPanel.Controls.Add(this.uxParametar);
			this.uxParametar.Location = new System.Drawing.Point(160, 208);
			this.Controls.Add(this.uxParametar);
			//
			// uxSelectUpitLabel
			//
			this.uxSelectUpitLabel.Text = "SelectUpit:";
			this.uxSelectUpitLabel.Location = new System.Drawing.Point(3, 234);
			this.Controls.Add(this.uxSelectUpitLabel);
			//this.uxTableLayoutPanel.Controls.Add(this.uxSelectUpitLabel);			
			//
			// uxSelectUpit
			//
			this.uxSelectUpit.Width = 250;
			this.uxSelectUpit.MaxLength = 400;
			//this.uxTableLayoutPanel.Controls.Add(this.uxSelectUpit);
			this.uxSelectUpit.Location = new System.Drawing.Point(160, 234);
			this.Controls.Add(this.uxSelectUpit);
			//
			// uxIDReport
			//				
			this.uxIDReport.DisplayMember = "Naziv";	
			this.uxIDReport.ValueMember = "ID";	
			//
			// uxIDReportKolumnaTip
			//				
			this.uxIDReportKolumnaTip.DisplayMember = "Naziv";	
			this.uxIDReportKolumnaTip.ValueMember = "ID";	
			// 
			// ReportKolumnaEditControlBase
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
			//this.Controls.Add(this.uxTableLayoutPanel);
			this.AutoScroll = true;
			this.Name = "ReportKolumnaEditControlBase";
			this.Size = new System.Drawing.Size(478, 311);
			//this.Localizable = true;
			((System.ComponentModel.ISupportInitialize)(this.uxErrorProvider)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.uxBindingSource)).EndInit();			
			this.ResumeLayout(false);
			this.PerformLayout();
		}
		#endregion
				
		#region ComboBox List
		
				
		private Entities.TList<Entities.Report> _IDReportList;
		
		/// <summary>
		/// The ComboBox associated with the IDReport property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.Report> IDReportList
		{
			get {return _IDReportList;}
			set 
			{
				this._IDReportList = value;
				this.uxIDReport.DataSource = null;
				this.uxIDReport.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDReportList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDReport property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDReportList
		{
			get { return _allowNewItemInIDReportList;}
			set
			{
				this._allowNewItemInIDReportList = value;
				this.uxIDReport.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
				
		private Entities.TList<Entities.ReportKolumnaTip> _IDReportKolumnaTipList;
		
		/// <summary>
		/// The ComboBox associated with the IDReportKolumnaTip property.
		/// </summary>
		[System.ComponentModel.Category("ComboBox BindingSources")]
		public Entities.TList<Entities.ReportKolumnaTip> IDReportKolumnaTipList
		{
			get {return _IDReportKolumnaTipList;}
			set 
			{
				this._IDReportKolumnaTipList = value;
				this.uxIDReportKolumnaTip.DataSource = null;
				this.uxIDReportKolumnaTip.DataSource = value;
			}
		}
		
		private bool _allowNewItemInIDReportKolumnaTipList;
		
		/// <summary>
		/// Indicates if the ComboBox associated with the IDReportKolumnaTip property allow user to add item.
		/// </summary>
		[System.ComponentModel.Category(".netTiers"), System.ComponentModel.Description("Indicates if end user can add a new item in the combobox. an event will be thrown then.")]
		public bool AllowNewItemInIDReportKolumnaTipList
		{
			get { return _allowNewItemInIDReportKolumnaTipList;}
			set
			{
				this._allowNewItemInIDReportKolumnaTipList = value;
				this.uxIDReportKolumnaTip.DropDownStyle = value ? System.Windows.Forms.ComboBoxStyle.DropDown : System.Windows.Forms.ComboBoxStyle.DropDownList;
			}
		}
		
		
		#endregion
		
		/// <summary> 
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.IContainer components = null;

		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing && (components != null))
			{
				components.Dispose();
			}
			base.Dispose(disposing);
		}
	}
}
